var express = require('express');
var router = express.Router()

const { signup, signin, auth, list, update, remove, upload } = require('../controllers/users')
const { auth: authMiddleware } = require('../middlewares/auth')
const uploadMiddleware = require('../middlewares/fileupload')

router.post('/signup', authMiddleware, signup)
router.post('/upload', authMiddleware, uploadMiddleware, upload)
router.patch('/update', authMiddleware, update)
router.delete('/remove', authMiddleware, remove)
router.post('/signin', signin)
router.get('/auth', auth)
router.get('/list', authMiddleware, list)

module.exports = router
